<#include "header.html">
<script type="text/javascript" src="js/md5.js"></script>
<script type="text/javascript">
function enCodePassword(){
	if($("#password") && $("#password").length){
		var password = $("#password").val();
		var confirmPwd = $("#confirmPwd").val();
		$("#password").val(JFT.encrypt(password));
		$("#confirmPwd").val(JFT.encrypt(confirmPwd));		
	}
	return true;
}
</script>
<div class="c_nav">
	<span>管理选项：</span>
	<a href="sysAdminAction.do?method=query">管理首页</a>
	<a href="javascript:location.reload()"> | [刷新页面]</a>
</div>
<div class="c_box bg_white">
	<form id="adminForm" name="adminForm" action="?method=save" method="post">
	<div class="c_topic"><#if admin.id??>修改<#else>新增</#if>管理员信息</div>
	<div class="c_form_3 c_form-label-6">
		<ul class="l_mb">
			<li>
				<span class="e_label e_label-required">登录账号：</span>
				<span class="e_input">
					<input type="text" name="adminUser" id="adminUser" desc="登录账号" nullable="no" datatype="mixchar" minlen="5" maxlen="20" maxlength="20" value="${admin.adminUser!}" <#if admin.adminUser??> readonly="readonly" </#if>/>
				</span>
			</li>
		</ul>
		<#if admin.id??> <#else>
		<ul class="l_mb">
			<li>
				<span class="e_label e_label-required">登录密码：</span>
				<span class="e_input">
					<input type="password" name="password" id="password" desc="登录密码" nullable="no" datatype="strongchar" minlen="5" maxlen="20" maxlength="20" value=""/>
				</span>
			</li>
			<li>
				<span class="e_label e_label-required">确认密码：</span>
				<span class="e_input">
					<input type="password" name="confirmPwd" id="confirmPwd" desc="确认密码" nullable="no" equal="password" minlen="5" maxlen="20" maxlength="20" value=""/>
				</span>
			</li>
		</ul>
		</#if>
		<ul class="l_mb">
			<li>
				<span class="e_label">真实姓名：</span>
				<span class="e_input">
					<input type="text" name="userName" id="userName" desc="真实姓名" maxlen="20" maxlength="20" value="${admin.userName!}"/>
				</span>
			</li>
			<li>
				<span class="e_label e_label-required">是否锁定：</span>
				<span class="e_radio">
					<label><input type="radio" name="locked" desc="是否锁定" nullable="no"<#if admin.locked==0> checked="checked"</#if> value="0"/> 正常</label>
					<label><input type="radio" name="locked" desc="是否锁定" nullable="no"<#if admin.locked==1> checked="checked"</#if> value="1"/> 锁定</label>
				</span>
			</li>
		</ul>
		<ul class="l_mb">
			<li>
				<span class="e_label">手机号码：</span>
				<span class="e_input">
					<input type="text" name="mobile" id="mobile" desc="手机号码" nullable="yes" datatype="mobile" maxlength="20" value="${admin.mobile!}"/>
				</span>
			</li>
			<li>
				<span class="e_label">电子邮箱：</span>
				<span class="e_input">
					<input type="text" name="email" id="email" desc="电子邮箱" nullable="yes" datatype="email" maxlength="30" value="${admin.email!}"/>
				</span>
			</li>
		</ul>
		<ul class="l_mb">
			<li class="col_2">
				<span class="e_label">备注：</span>
				<span class="e_input">
					<input type="text" name="remark" id="remark" desc="备注" nullable="yes" maxlen="100" maxlength="100" value="${admin.remark!}"/>
				</span>
			</li>
		</ul>
		<ul class="clearfix l_col_auto l_mb">
			<li class="l_li" style="width:10%">
				<span class="e_label e_label-required">管理角色：</span>
			</li>
			<li class="l_right">
				<div class="c_table e_center l_mt">
					<table>
						<tr>
							<th>选择角色</th>
							<th>角色名称</th>
							<th>角色编码</th>
							<th>角色层级</th>
						</tr>
			            <#list roles as r>
						<tr>
							<td><input type="checkbox" name="roleCode" desc="角色" nullable="no" <#if r.checked> checked="checked"</#if> value="${r.roleCode!}"/></td>
							<td>${r.roleName}</td>
							<td>${r.roleCode!}</td>
							<td>${r.roleLevel!}</td>
						</tr>
						</#list>
					</table>
				</div>
			</li>
		</ul>
	</div>
	<div class="e_center">
		<input type="hidden" name="adminId" id="adminId" value="${admin.id!}"/>
		<button type="button" bind="save" tradeAction="enCodePassword()" bindForm="adminForm" class="e_btn-page">提交</button>
		<button type="reset" class="e_btn l_ml">重置</button>
	</div>
    </form>
</div>
<#include "footer.html">